/* eslint valid-jsdoc: "off" */


/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = exports = {};

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1715245999956_5729';


  // add your middleware config here
  config.middleware = [];

  config.errorString = {
    repeatCreateEnv: '当前环境已经创建, 请勿重复创建环境',
    repeatUpdateEnv: '当前修改环境重复, 请勿调整修改',
    notCreateEnv: '当前环境尚未创建，请先创建环境',
    repeatCreateApp: '当前应用已经创建,请勿重复创建应用',
    repeatUpdateApp: '当前修改应用重复,请调整修改',
    notCreateApp: '当前应用尚未创建，请先创建应用',
    notUpdateEnv: '需要修改的环境尚未创建, 请先创建环境',
    notSendLoginCode: '登录验证码尚未发送,请先获取验证码',
    passOrCodeIsError: '密码或验证码错误',
    initSystem: '系统初始化未完成',
    emailError: '当前邮箱与预留邮箱不符,请重新输入',
    codeSendError: '当前验证码未发送或者验证码已到期',
    codeError: '验证码错误',
    codeTimeError: '验证码已过期或未发送验证码',
    sendEmailCodeError: '请先发送验证码在进行邮箱验证 或 验证码已到期请重新发送验证码',
    repeatBindEmailError: '当前系统已绑定邮箱,请勿重复绑定',
    codeSendRepeatError: '5分钟内请勿重新发送验证码',
    repeatCreateConfig: '当前配置已经创建, 请勿重复创建配置',
    notExistConfig: '当前配置尚未创建，请先创建配置',
  };


  config.option = {
    success: {
      code: 200,
      msg: '操作成功',
      data: null,
    },
    failed: {
      code: 500,
      msg: '操作成功',
      data: null,
    },
  };
  config.security = {
    csrf: {
      enable: false,
    },
  };

  config.sm = {
    key: '0123456789abcdeffedcba9876543210',
    mode: 'cbc',
    iv: 'fedcba98765432100123456789abcdef',
  };


  // add your user config here
  const userConfig = {
    // myAppName: 'egg',
  };

  return {
    ...config,
    ...userConfig,
  };
};
